package com.ruoyi.project.param.paeaParaSystem.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 功能描述：
 *
 * @author 关晓强
 * @version 1.0
 * @date 2020/3/18 21:23
 */
public enum ArchiveServerType {
    通用("通用", "通用"),
    扫描专用("扫描专用", "扫描专用"),
    OCR专用("OCR专用","OCR专用"),
    查询专用("查询专用","查询专用");
    private static Map<String, ArchiveServerType> codeMap;
    private static Map<String, ArchiveServerType> nameMap;
    static{
        codeMap = new HashMap<String, ArchiveServerType>();
        nameMap = new HashMap<String, ArchiveServerType>();
        for(ArchiveServerType type : ArchiveServerType.values()){
            codeMap.put(type.getCode(), type);
            nameMap.put(type.getName(), type);
        }
    }
    public static ArchiveServerType getCodeByName(String name){
        return nameMap.get(name);
    }
    public static ArchiveServerType getNameByCode(String code){
        return codeMap.get(code);
    }


    private String code;
    private String name;
    private ArchiveServerType(String code, String name) {
        this.code = code;
        this.name = name;
    }
    public String getCode() {
        return code;
    }
    public String getName() {
        return name;
    }
}
